<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld"  prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld"  prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/custom-html.tld" prefix="chtml" %>
<%@ taglib uri="/WEB-INF/tlds/struts-template.tld" prefix="template" %>

<%@ page import="com.erp.app.common.ProjectConstants"%>
<%@ page import="com.erp.framework.util.CommonUtil" %>
<%@ page import="com.erp.framework.util.user.User" %>
<%@ page import="com.erp.app.common.ProjectConstants" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.erp.app.util.web.WebUtil" %>

<%@ page import="java.util.ArrayList" %>
<%@ page import="com.erp.framework.util.mainmenu.MenuObject" %>
<%@ page import="com.erp.app.common.ProjectConstants" %>
<%@ page import="com.erp.app.login.web.MainMenuAction" %>
<%@ page import="com.erp.app.login.taskEnquiry.vo.TaskEnquiryVo"%>

<jsp:useBean id="mainMenuForm" scope="session" type="com.erp.app.login.web.MainMenuForm" />

<!-- NEVER call doLoad() function here, call it via its root parent jsp  -->

<%
ArrayList taskFabricEnqList = mainMenuForm.getTaskFabricEnquiryList();
pageContext.setAttribute("taskFabricEnqList", taskFabricEnqList);

ArrayList resultList = mainMenuForm.getResultList();
pageContext.setAttribute("resultList", resultList);
%>

<table width=100% cellspacing=0 class="table_middle_search">
	<tr>
		<td  nowrap>
			<font size=1 face="arial"><bold>Search By Proj NO:</bold></font></td>
		<td>
			<INPUT TYPE="text" NAME="srchTaskProjNo" class="textbox1" maxlength="20" size="10" value="<%=CommonUtil.nullToString(mainMenuForm.getSrchTaskProjNo())%>">
		</td>
		<td>
			<INPUT TYPE="button" onclick="javascript:doSubmitEnqMenuFormOtherAction('actionEnquiry', 'actionTaskFabricEnquiry');" value="search" class="enq_input">&nbsp;<INPUT TYPE="button" onclick="javascript:doSubmitEnqMenuFormOtherAction('actionEnquiry', 'actionTaskFabricEnquiry', 'clear');" value="clear" class="enq_input">
		</td>
	</tr>
</table>
<table width=100% cellspacing=0>
	<tr>
		<td colspan=3>
			<font color='red' size=1><html:errors/></font>
		</td>
	</tr>
	<tr>
		<td colspan=3 class="grid_page" nowrap>
		<%if(mainMenuForm.getTotalPage() == 0 ) { %>
			&nbsp;
		<%} else { %>
			Page <%=mainMenuForm.getCurrentPage()%> of <%=mainMenuForm.getTotalPage()%>
		<%} %>
			<input type="button" class="button1" value="&lt;&lt;" onClick="javascript:doSubmitEnqMenuFormOtherAction('actionEnquiry', 'scrollLeft');" <%=mainMenuForm.getSidx() == 0 ? "disabled" : ""%>>
			<input type="button" class="button1" value="&gt;&gt;" onClick="javascript:doSubmitEnqMenuFormOtherAction('actionEnquiry', 'scrollRight');" <%=mainMenuForm.getSidx() < Integer.parseInt(mainMenuForm.getLastPageSidx()) ? "" : "disabled"%>>
		</td>
	</tr>
</table> 
 
<table class='outline-table' width="100%"  border="0" cellspacing="0" cellpadding="0">

	<tr>
		<th class="outline-th" nowrap>
			Proj.No.
		</th>
		<th class="outline-th" nowrap>
		    Task
		</th>
		<th class="outline-th" nowrap>
			Task Due Date
		</th>
	</tr>	

<logic:iterate id="taskFabricEnqItem" name="resultList" indexId="idx" length="<%=String.valueOf(ProjectConstants.MAX_SHORT_DISPLAY)%>" offset="<%=String.valueOf(mainMenuForm.getSidx())%>">

	<%
	TaskEnquiryVo vo = (TaskEnquiryVo)taskFabricEnqItem;
	%>
	<%--
	<tr class="row_action_default" onmouseover="mouseOverHighlight(event,'row_action_hilite')"
		onmouseout="mouseOutHighlight('row_action_default')"
		onclick="javascript:doEditEnqMenuForm('actionEnquiry', 'editDoc', '<%=ProjectConstants.MOD_PROJ_FABRIC_TASK%>', '<%=vo.getProjNo()%>', '<%=vo.getLineNo()%>', '<%=vo.getTaskLineNo()%>');">
	--%>
	<tr class="row_action_default" onmouseover="mouseOverHighlight(event,'row_action_hilite')"
		onmouseout="mouseOutHighlight('row_action_default')"
		onclick="javascript:doEditAlertTask('<%=ProjectConstants.DOC_FABRIC_RECAP%>', '<%=vo.getProjNo()%>');">
		<td class="outline-td"> 
			<bean:write name="taskFabricEnqItem" property="projNo" filter="true"/>&nbsp;
		</td>
		<td class="outline-td"> 
			<bean:write name="taskFabricEnqItem" property="taskDesc" filter="true"/>&nbsp;
		</td>
		<td class="outline-td">
			<%=CommonUtil.dateToString(vo.getApproveDate())%>
			&nbsp;
		</td>
	</tr>
	</logic:iterate>
</table>